//
//  BaseViewController.m
//  BaishidaiKnight
//
//  Created by mac book on 2019/1/28.
//  Copyright © 2019年 sy. All rights reserved.
//

#import "BaseViewController.h"
#import <IQKeyboardManager/IQKeyboardManager.h>
#import <IQKeyboardManager/IQToolbar.h>

@interface BaseViewController ()


@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //布局 不延伸

    [self.view setBackgroundColor:[UIColor whiteColor]];
    self.automaticallyAdjustsScrollViewInsets = NO;

    [self initNavigationBar];
    
    IQKeyboardManager *manager = [IQKeyboardManager sharedManager];
    manager.enable = YES;
    manager.shouldResignOnTouchOutside = YES; // 控制点击背景是否收起键盘
    
}
-(void)initNavigationBar
{
    
    //返回按钮
    if (self.navigationController.viewControllers.count > 1) {
        
        UIBarButtonItem *backButton =[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"btn_return_b"] style:UIBarButtonItemStylePlain target:self action:@selector(back)];
        self.navigationItem.leftBarButtonItem = backButton;
    }
    
}

- (void)back {
    
    [self.navigationController popViewControllerAnimated:YES];
}





@end
